package com.twang.stock.task;

import com.twang.stock.service.TodayReDuOnehourService;
import com.twang.stock.strategy.WarnVipNewsService;
import com.twang.stock.threadPool.AsycTaskExecutorConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 同花顺1小时热度榜（）
 */
@Slf4j
@Component
public class WarnNewsTask {

    @Autowired
    private WarnVipNewsService warnVipNewsService;

    @Autowired
    private AsycTaskExecutorConfig asycTaskExecutorConfig;
    @Scheduled(cron = "0 0/1 * * * ? ")
    public void warn() throws Exception {
     log.info("消息刷新");
        asycTaskExecutorConfig.taskQueueExecutor().execute(() -> {
            try {
                warnVipNewsService.process();
            } catch (Exception e) {
                log.info("error = {}", e);
            }
            log.info("==========> 消息刷新  WarnVipNewsService end!");
        });
    }




}
